define([], function(){
	var tpl = {};
	
	tpl.init = function(domId){
		var html = dropdown();
		$("#"+domId).html(html);
	}
	
	var dropdown = function(){
		return 	'<script id="tpl_application_dropdown" type="text/html">'+
				'	<li class="dropdown">'+	
				'		{{each apps as app i}}'+
				'			{{if app.status == 1}}'+
			    '				<a href="#" class="dropdown-toggle" data-toggle="dropdown">'+	
			   	'					<label class="logo-icon" style="background:url({{app.logo}})"></label>'+	
			    '					<span class="hidden-xs tenant_name">{{app.tenantName}}</span>'+	
			    '					{{if i>0}}'+
			   	'						<span class="caret"></span>'+	
			    '					{{/if}}'+
			    '				</a>'+
			    '			{{/if}}'+
			    '		{{/each}}'+
			    '		{{if apps.length>1}}'+
			    '			<ul class="dropdown-menu">'+	
			    '				{{each apps as app i}}'+
				'					{{if app.status != 1}}'+
			    '						<li><a href="#"><span>app.tenantName</span></a></li>'+	
			    '					{{/if}}'+
			    '				{{/each}}'+
				'			</ul>'+
				'		{{/if}}'+
			    '	</li>'+
			    '</script>';
	}
	return tpl;
});